#! /bin/bash
############################################################################
#									   #
# MGPI Framework Instalation Script - use it either command combination:  #
#	1. make all							   #
#	2. sudo make install						   #
# to make and install binaries of the MGPI Framework.			   #
#									   #
# MGPI Framework is under GPL license. See COPYING file for details.	   #
#									   #
############################################################################

echo "MGPI Framework Instalation Script - use it either command combination:"
echo "	1. make all"
echo "	2. sudo make install"
echo "to make and install binaries of the MGPI Framework."
echo ""
echo "MGPI Framework is under GPL license. See COPYING file for details."
echo ""
echo "You are about to install the MGPI Framework to Your computer."
echo "Do You wish to continue?('y' or 'Y' for yes)"
read word

if [ "$word" != "Y" ] && [ "$word" != "y" ]; then
	exit 1
else
	rm -f *~
	echo "Clean the binenaries?('n' or 'N' for no)"
	read word
	if [ "$word" != "n" ] && [ "$word" != "N" ]; then
		make clean
		echo "Binaries cleaned."
    else
        sh ./mkbindirs
	fi
	make all
	sudo make install
fi

